package com.gdsdxy.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gdsdxy.entity.Follow;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface FollowMapper extends BaseMapper<Follow> {
    /**
     * 根据用户id查询关注列表
     * @param userId
     * @return
     */
    @Select("SELECT follow_user_id FROM tb_follow WHERE user_id=#{userId}")
    public List<Follow> selectFollow(Long userId);

    /**
     * 根据用户id查询粉丝列表
     * @param followUserId
     * @return
     */
    @Select("SELECT user_id FROM tb_follow WHERE follow_user_id=#{followUserId}")
    public List<Follow> selectFans(Long followUserId);
}
